I have a module that uses Attribute DXL to put its value into another (non-DXL) attribute. |
Re: Force update of Attribute DXL?
First set the attribute DXL to have a null value and then query the value. Or as DXL Help describes it "The calculation only takes place the first time the attribute is accessed, or if it is later cleared to null and is subsequently accessed again. This means the DXL code is not executed when the containing module is opened, but when some event occurs that causes the attribute to be accessed."
Object o
Module m = some_module
for o in m do {
current = o
o.DXL_Attribute = (string null)
string tempStr = o.DXL_Attribute ""
}
|
Re: Force update of Attribute DXL? SystemAdmin - Fri Dec 04 00:59:55 EST 2009
First set the attribute DXL to have a null value and then query the value. Or as DXL Help describes it "The calculation only takes place the first time the attribute is accessed, or if it is later cleared to null and is subsequently accessed again. This means the DXL code is not executed when the containing module is opened, but when some event occurs that causes the attribute to be accessed."
Object o
Module m = some_module
for o in m do {
current = o
o.DXL_Attribute = (string null)
string tempStr = o.DXL_Attribute ""
}
The method you posted is a partial solution that may work in your instance. Full solution is given by IBM in wipeattr.dxl. |
Re: Force update of Attribute DXL? doors36677 - Fri Dec 04 08:15:11 EST 2009 |
Re: Force update of Attribute DXL? doors36677 - Fri Dec 04 08:15:11 EST 2009 /* This function forces a recalculation of any attributes which are driven by attribute DXL on all displayed objects in the module. */ That is, it only forces those attribute DXL to recalculate that are displayed in the current view. Therefore, the second step proposed by Pekka is at least for the not displayed attribute DXL required to have them recalculated as well. Note also the related explanation in the DXL reference. HTH Markus |
Re: Force update of Attribute DXL?
AttrDXL is calculated the first time the value is used after opening the module, and whenever the value is set to null. All object valules are set to null by the Tools menu >Recalculate DXL Attr command.
string Value
Object obj
Module mod = edit(MyModuleName, false)
for obj in entire mod do
{ Value = obj.NameAttrDXL
}
close(mod)
|